package cn.tiancaifan.micro.mapper;


import cn.tiancaifan.micro.entity.*;
import cn.tiancaifan.micro.entity.statistic.Static;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMapper {

    /**
     * 按性别统计人数
     * @return
     */
    List<Static> statisticByGender();

    List<Static> statisticByDepartment();


    List<Student> getStudentByPage(@Param("stu") Student student, @Param("page") Integer page, @Param("size") Integer size);

    Long getTotal(@Param("stu") Student student);

    @Select("select * from nation")
    List<Nation> getNations();

    @Select("select * from job")
    List<Job> getJobs();

    @Select("select * from politicsstatus")
    List<Politicsstatus> getPoliticsstatus();

    @Select("select id,name from department")
    List<Department> getDeps();

    @Select("select id,name from position")
    List<Position> getPositions();

    @Delete("delete from student where id = #{id}")
    int deleteStudentById(Integer id);

    int addStu(Student student);

    Integer maxWorkID();

    Integer updateStudentById(Student student);

    int addStus(@Param("list") List<Student> students);
}